#include <stdio.h>
#include "seqqueue.h"

int main(int argc, char const *argv[])
{
        int i = 0;
        int a[10] = {0};
        SeqQueue* queue = NULL;
        
        queue = SeqQueue_Create(10);
        if(queue == NULL){
                printf("SeqQueue_Create failed\n");
                return -1;
        }

        //入队列
        for (i = 0; i < 5; i++){
                a[i] = i + 1;
                SeqQueue_Append(queue, &a[i]);
        }
        
        //打印队列
        printf("队列的长度:%d\n", SeqQueue_Length(queue));
        printf("队头:%d\n", *((int *)SeqQueue_Header(queue)));
        printf("队列的容量:%d\n", SeqQueue_Capacity(queue));

        //出队列
        while (SeqQueue_Length(queue) > 0  ){
                int tmp = *((int *)SeqQueue_Retrieve(queue));
                printf("%d ", tmp);
        }
        printf("\n");

        SeqQueue_Destory(queue);
        return 0;
}
